def get_prime(n):
    st = [True] * (n + 1)
    st[0] = st[1] = False
    p = 2
    while p * p <= n:
        if st[p]:
            for i in range(p * p, n + 1, p):
                st[i] = False
        p += 1
    return [i for i in range(n + 1) if st[i]]

n = eval(input('请输入想要求多少以内的质数'))
print(get_prime(n))




